package com.example.leo.mycharmingstudent.a0914;

import java.io.Serializable;

/**
 * Created by Leo on 2020/9/14.
 */

public class StudentEntity implements Serializable{

    private String name;
    private String sex;
    private String age;
    private String weight;
    private String height;
    private StudentEntityINNER inner;

    /**
     *按住shift可以实现区域选择
     *按住Ctrl可以实现多选
     */
    public StudentEntity(String name,
                         String sex,
                         String age,
                         String weight,
                         String height) {
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.weight = weight;
        this.height = height;
        inner = new StudentEntityINNER();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public String getWeight() {
        return weight;
    }

    public void setWeight(String weight) {
        this.weight = weight;
    }

    public String getHeight() {
        return height;
    }

    public void setHeight(String height) {
        this.height = height;
    }

    /**
     * Caused by: java.io.NotSerializableException: com.example.leo.mycharmingstudent.a0914.StudentEntity$StudentEntityINNER
     * 传递数据时，报错，上述异常。NotSerializableException：StudentEntityINNER
     * 异常分析：
     * 第一，NotSerializableException没有序列化异常
     * 第二，指出了没有序列化的类StudentEntityINNER
     * 第三，综上，StudentEntityINNER没有实现序列化
     * 解决方案：implements Serializable
     */
    public static class StudentEntityINNER implements Serializable{

    }
}
